import QtQuick 2.4
import QtQuick.Controls 2.5

Rectangle {
    id: dialog
    anchors.fill: parent
    color: "lightblue"

    property var target : null
    property alias name: name
    property alias dial: dial
    property alias button1: button1
    property alias button: button
    width: 400
    height: 350

    Column {
        id: column
        anchors.fill: parent

        Label {
            id: label
            text: qsTr("Enter a name:")
        }

        TextField {
            id: name
            width: parent.width
            text: "Cat"
            anchors.top: label.bottom
            anchors.topMargin: 5
        }

        Row {
            id: row
            width: parent.width
            anchors.top: name.bottom
            anchors.topMargin: 10

            Dial {
                id: dial
            }
        }



        Row {
            id: row2
            height: 40
            width: parent.width
            anchors.bottom: parent.bottom
            anchors.bottomMargin: 7
            Button {
                id: button
                text: "OK"
                anchors.left: parent.left
                anchors.leftMargin: 150
                onClicked: {
                    if (target) target.text = name.text
                    dialog.destroy()
                }
            }

            Button {
                id: button1
                text: "Cancel"
                anchors.right: parent.right
                anchors.rightMargin: 25
                onClicked: dialog.destroy()
            }
        }

     }
}


